Occurs after a connection is established to the server.
Private Sub object.Connect(ErrorOccurred As Boolean)
Part | Description |
object | An object expression that evaluates to an object in the Applies To list. |
ErrorOccurred | A Boolean expression that determines whether the connection was successful, as described in Settings. |
Settings
The ErrorOccurred argument will be set to one of the following values:
Value | Description |
True | The connection failed. |
False | The connection succeeded. |
Remarks
You can catch the Connect event and do any kind of initial queries required on a new connection, such as verifying the version of the database against the version of the client or setting a default database not established in the connect string. You can also check for errors or messages returned during the process of opening the connection — or perhaps simply clear the rdoErrors collection of informational messages.